package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.Scenic;
import cn.wolfcode.wolf2w.service.IScenicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("scenic")
public class ScenicController {

    @Autowired
    private IScenicService scenicService;

    @RequestMapping("/list")
    public Object list(){

        List<Scenic> list = scenicService.list();

        return list;
    }

    @PostMapping("/get")
    public Object get_(String id){
        Scenic scenic = scenicService.get(id);
        return scenic;
    }
}
